﻿//------------------------------------------------------------
// Game Framework v3.x
// Copyright © 2013-2017 Jiang Yin. All rights reserved.
// Homepage: http://gameframework.cn/
// Feedback: mailto:jiangyin@gameframework.cn
//------------------------------------------------------------

#if DEBUG_WINDOW
namespace UnityGameFramework.Runtime
{
    public partial class DebuggerComponent
    {
        private sealed class ScreenCustomWindow : GameFramework.Debugger.IDebuggerWindow
        {
            shaco.ICustomDebugWindow _customWindow;

            public void Initialize(params object[] args)
            {
                _customWindow = shaco.GameHelper.customDebugWindow;
                _customWindow.Initialize(args);
            }

            public void OnShowFullScreen()
            {
                try
                {
                    _customWindow.OnShowFullScreen();
                }
                catch (System.Exception ex)
                {
                    UnityEngine.Debug.LogError("ScreenCustomWindow OnShowFullScreen error: e=" + ex);
                }
            }

            public void OnDraw()
            {
                _customWindow.OnDraw();
            }

            public void OnEnter()
            {
                _customWindow = shaco.GameHelper.customDebugWindow;
                _customWindow.OnEnter();
            }

            public void OnLeave()
            {
                _customWindow.OnLeave();
            }

            public void OnUpdate(float elapseSeconds, float realElapseSeconds)
            {
                _customWindow.OnUpdate(elapseSeconds, realElapseSeconds);
            }

            public void OnUpdateWhenMinimizeWindow()
            {
                _customWindow.OnUpdateWhenMinimizeWindow();
            }

            public void Shutdown()
            {
                _customWindow.Shutdown();
            }
        }
    }
}
#endif